cmake_minimum_required(VERSION 2.8.4)

SET(PRJ_NAME 				sqlite3samples)

SET(PRJ_ROOTDIR				${CMAKE_CURRENT_SOURCE_DIR} )
SET(SQLITE3_SRCDIR 			${PRJ_ROOTDIR}/sqlite-autoconf-3250200 )

PROJECT(${PRJ_NAME} 		C CXX)

MESSAGE(STATUS "sqlite3 samples.")

	MESSAGE(STATUS "@@@ Host platform: Windows Cygwin")

INCLUDE_DIRECTORIES( 
	"${PRJ_ROOTDIR}"
	"${SQLITE3_SRCDIR}"
	"${PRJ_ROOTDIR}/local/include"
)

LINK_DIRECTORIES(
	"${PRJ_ROOTDIR}/build"
	"${PRJ_ROOTDIR}/local/lib"
)
	
	SET(cflags	-std=gnu99)
	ADD_DEFINITIONS(${cflags})

	ADD_LIBRARY(sqlite3_static STATIC ${SQLITE3_SRCDIR}/sqlite3.c)
	SET_TARGET_PROPERTIES(sqlite3_static PROPERTIES OUTPUT_NAME "sqlite3")

	#ADD_LIBRARY(sqlite3_shared SHARED ${SQLITE3_SRCDIR}/sqlite3.c)
	#SET_TARGET_PROPERTIES(sqlite3_shared PROPERTIES OUTPUT_NAME "sqlite3")

	ADD_EXECUTABLE(sample1  
		${PRJ_ROOTDIR}/query_exe.c 
	)

	TARGET_LINK_LIBRARIES(sample1  
	-lsqlite3
	)

